package com.skyinno.mrms.utils;

import java.sql.Timestamp;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.propertyeditors.PropertiesEditor;

public class TimestampEditor extends PropertiesEditor {

    @Override
    public void setAsText(String arg0) throws IllegalArgumentException {
        this.setValue(StringUtils.isBlank(arg0) ? null : Timestamp.valueOf(arg0
                .length() == 10 ? arg0 + " 00:00:00" : arg0));
    }
}
